package com.zy.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.business.domain.TbHkReady;
import com.zy.common.core.domain.AjaxResult;
import com.zy.business.mapper.HkReadyMapper;
import com.zy.business.service.HkReadyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description: 海康门禁 服务层实现
 * @author: whf
 * @create: 2022-07-30 17:37
 **/
@Service
public class HkReadyServiceImpl extends ServiceImpl<HkReadyMapper, TbHkReady> implements HkReadyService {

    @Autowired
    private HkReadyMapper readyMapper;

    @Override
    public List<TbHkReady> getReadyList() {
        List<TbHkReady> hkReadyList = readyMapper.selectList(new QueryWrapper<TbHkReady>());
        return hkReadyList;
    }

    @Override
    public AjaxResult add(TbHkReady hkReady){
        readyMapper.insert(hkReady);
        return AjaxResult.success();
    }

    @Override
    public AjaxResult delete(TbHkReady hkReady){
        readyMapper.deleteById(hkReady.getId());
        return AjaxResult.success();
    }
}
